package com.jrwd.recycletest;

import android.app.Application;

import com.jrwd.okhttputils.OkHttpUtils;
import com.jrwd.okhttputils.cookie.store.PersistentCookieStore;
import com.tencent.bugly.crashreport.CrashReport;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

/**
 * Created by ${templefck} on 2018/8/1.
 */
public class MyApp extends Application {
    public static String channel = null;

    {
        PlatformConfig.setWeixin("wxdc1e388c3822c80b", "3baf1193c85774b3fd9d18447d76cab0");
        //豆瓣RENREN平台目前只能在服务器端配置
        PlatformConfig.setSinaWeibo("3921700954", "04b48b094faeb16683c32669824ebdad", "http://sns.whalecloud.com");
        PlatformConfig.setYixin("yxc0614e80c9304c11b0391514d09f13bf");
        PlatformConfig.setQQZone("100424468", "c7394704798a158208a74ab60104f0ba");
        PlatformConfig.setTwitter("3aIN7fuF685MuZ7jtXkQxalyi", "MK6FEYG63eWcpDFgRYw4w9puJhzDl0tyuqWjZ3M7XJuuG7mMbO");
        PlatformConfig.setAlipay("2015111700822536");
        PlatformConfig.setLaiwang("laiwangd497e70d4", "d497e70d4c3e4efeab1381476bac4c5e");
        PlatformConfig.setPinterest("1439206");
        PlatformConfig.setKakao("e4f60e065048eb031e235c806b31c70f");
        PlatformConfig.setDing("dingoalmlnohc0wggfedpk");
        PlatformConfig.setVKontakte("5764965", "5My6SNliAaLxEm3Lyd9J");
        PlatformConfig.setDropbox("oz8v5apet3arcdy", "h7p2pjbzkkxt02a");

    }
    @Override
    public void onCreate() {
        super.onCreate();
        UMConfigure.setLogEnabled(true);

        //初始化组件化基础库, 统计SDK/推送SDK/分享SDK都必须调用此初始化接口
        UMConfigure.init(this, "59892f08310c9307b60023d0", "Umeng", UMConfigure.DEVICE_TYPE_PHONE,
                "669c30a9584623e70e8cd01b0381dcb4");
        initOkHttp();

    }
    /**
     * 初始化OkHttp请求框架
     */
    private void initOkHttp() {
        //初始化腾讯bugly
        CrashReport.initCrashReport(getApplicationContext(), "70e8514848", false);
        OkHttpUtils.init(this);
        OkHttpUtils.getInstance()
                .setConnectTimeout(10000)       //设置连接超时
                .setReadTimeOut(10000)         //设置读取超时
                .setWriteTimeOut(10000)         //设置写入超时
                //.addInterceptor(new LogInterceptor())
                .setCookieStore(new PersistentCookieStore(this));//设置cookie管理器,有两种(内存和持久化)
//                .debug("JHH");
    }


}
